package com.dimong.loan.sdk.utils;

import com.dimong.loan.sdk.app.BaseApplication;

/**
 * Created by wuligang on 2018/3/28.
 */

public class Tool {

    /**
     * 获取颜色值
     *
     * @param colorId
     * @return
     */
    public static int getColorById(int colorId) {
        return BaseApplication.getApplication().getResources()
            .getColor(colorId);
    }

    /**
     * 获取字符串
     *
     * @param id
     * @return
     */
    public static String getStringById(int id) {
        return BaseApplication.getApplication().getResources().getString(id);
    }

    /**
     * 获取字符串
     *
     * @param id
     * @return
     */
    public static String[] getStringArrayById(int id) {
        return BaseApplication.getApplication().getResources().getStringArray(id);
    }

    /**
     * 获取长度
     *
     * @param id
     * @return
     */
    public static float getSizeById(int id) {
        return BaseApplication.getApplication().getResources().getDimension(id);
    }

}
